<me:UIWBBST x:Class="WPFExcelReport.TWZAV12"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
                    xmlns:WFW="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    FTAUTOSUM="True"
                    SKEY1="WBBART" 
                     KEY1="WBBISTKLG"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWBBST.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/> 
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:KM2YD x:Key="KM2YD"/>
        <ucd:M2YD x:Key="M2YD"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:TextTrimmingConverter x:Key="trim"/>
    </me:UIWBBST.Resources>
    <Grid IsEnabled="{Binding IsBusy,Converter={StaticResource not}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <WrapPanel> 
                <Button Click="NewCommand" Height="20" Margin="5,0,0,0" Width="60" 
                        Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                        Content="{Binding Source={Localization:Translate Word=进入回修}}" />
                
                <Button Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="60"
                        Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                        Content="{Binding Source={Localization:Translate Word=完成回修}}"/>
            </WrapPanel>
            <DataGrid  Grid.Row="1" Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                       IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster" 
                    RowDetailsVisibilityMode="Visible"  Margin="0,0,0,0">
                <DataGrid.Columns>
                    <DataGridCheckBoxColumn Width="40" Binding="{Binding Path=IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGridRow}}}">
                        <DataGridCheckBoxColumn.HeaderTemplate>
                            <DataTemplate>
                                <CheckBox x:Name="ckbSelectedAll" Checked="ckbSelectedAll_Click" Unchecked="ckbSelectedAll_Unchecked"></CheckBox>
                            </DataTemplate>
                            </DataGridCheckBoxColumn.HeaderTemplate>
                    </DataGridCheckBoxColumn>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=分批}}" Binding="{Binding WBBTP, Converter={StaticResource ResourceKey=pnum}}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=序号}}" Binding="{Binding WBBFOLGE, Converter={StaticResource ResourceKey=pnum}}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=布卷号}}" Binding="{Binding WBBSTKNR, Converter={StaticResource ResourceKey=pnum}}"/>
                    <DataGridTextColumn  Header="{Binding Source={Localization:Translate Word=数量(米)}}" Binding="{Binding WBBISTKLG,Converter={StaticResource ResourceKey=d1000}}"/>
                </DataGrid.Columns>
            </DataGrid>
            <ex:TPage  Grid.Row="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
            <WrapPanel Grid.Row="3">
                <ex:TSUMWB/>
                <ex:TPROCESS/>
            </WrapPanel> 
        </Grid>
    </Grid>
</me:UIWBBST>
